{% load humanize %}

{% block post %}
    <h3><a href="{{ post.get_absolute_url }}">{{ post.title }}</a></h3>
    <p class="byline">{{ post.get_author.name }}, {{ post.pub_date|naturalday:date_format }} at {{ post.pub_date|date:time_format }}</p>
    <div class="body">{{ post.body|safe }}</div>
    <p class="tags">

    {% if post.get_tags %}
        Tagged with 
        {% for tag in post.get_tags %}
            <a href="{% url blogs.main.tag blog_slug,tag.name %}">{{ tag.name }}</a>{% if not forloop.last %}, {% endif %}
        {% endfor %}
    {% else %}
        No tags
    {% endif %}
{% endblock %}

{# Hide comments for single post view #}
{% if post.comments_enabled %}
    {% ifnotequal page_class 'post' %}| <a href="{{ post.get_absolute_url }}#comments">Comment{{ post.get_comments|pluralize }} ({{ post.get_comments|length }})</a>{% endifnotequal %}
{% endif %}

{# If user is an admin, show the edit link #}
{% if is_admin %}| <a href="{% url blogs.dashboard.post_edit blog_slug,post.slug %}?back={% url blogs.main.index blog_slug %}">Edit this post</a>{% endif %}</p>
